{if $form.onsubmit != ''}
<script type="text/javascript">
    <!--
        this['{$form.onsubmit|escape:'quotes'}'] = function (form) {literal}{{/literal}
            var message = '';
            {section name=item loop=$form.items}
                {if $form.items[item].required}
                    message += form['{$form.items[item].name|escape:'quotes'
                    }'].value === '' ? '{$form.items[item].label|escape:'quotes'}\n' : '';
                {/if}
            {/section}
            if (message !== '') {literal}{{/literal}
                alert('{$form.submitError}\n' + message);
                return false;
            {literal}}{/literal}
            return true;
        {literal}};{/literal}
    //-->
</script>
{/if}
{$form.start}
<fieldset>
<legend>{$form.legend}</legend>
{section name=item loop=$form.items}
{if $form.items[item].type == 'hidden'}
<input type="hidden" name="{$form.items[item].name}" value="{$form.items[item].value}" />
{/if}
{/section}
<table>
    {section name=item loop=$form.items}
    {if $form.items[item].type != 'hidden'}
    <tr>
        <td>{$form.items[item].label}{if $form.items[item].required}
            <span class="required">*</span>
            {/if}</td>
        <td>{if $form.items[item].type == 'password'}
            <input type="password" name="{$form.items[item].name}" value="{$form.items[item].value}" />
        {elseif $form.items[item].type == 'html'}
            {$form.items[item].html}
        {elseif $form.items[item].type == 'textarea'}
            <textarea name="{$form.items[item].name}" cols="{$form.items[item].cols}" rows="{$form.items[item].rows}"{if $form.items[item].class} class="{$form.items[item].class}"{/if}>{$form.items[item].value}</textarea>
        {elseif $form.items[item].type == 'select'}
            {if $form.items[item].multiple}
                <select name="{$form.items[item].name}" multiple="multiple" size="{$form.items[item].size}">
                    {html_options options=$form.items[item].options selected=$form.items[item].selected}
                </select>
            {else}
                {html_options name=$form.items[item].name options=$form.items[item].options selected=$form.items[item].selected}
            {/if}
        {elseif $form.items[item].type == 'file'}
            <input type="file" name="{$form.items[item].name}" />
        {elseif $form.items[item].type == 'checkbox'}
            <input type="checkbox" name="{$form.items[item].name}" value="{$form.items[item].value}"{if $form.items[item].checked} checked="checked"{/if} />
        {elseif $form.items[item].type == 'radio'}
            <input type="radio" name="{$form.items[item].name}" value="{$form.items[item].value}"{if $form.items[item].checked} checked="checked"{/if} />
        {elseif $form.items[item].type == 'rating'}
            {$negativeRating}
            <input type="radio" name="{$form.items[item].name}" value="0" />
            <input type="radio" name="{$form.items[item].name}" value="0.25" />
            <input type="radio" name="{$form.items[item].name}" value="0.5" checked="checked" />
            <input type="radio" name="{$form.items[item].name}" value="0.75" />
            <input type="radio" name="{$form.items[item].name}" value="1" />
            {$positiveRating}
        {else}
            <input type="text" name="{$form.items[item].name}" value="{$form.items[item].value}" />
        {/if}</td>
    </tr>
    {/if}
    {/section}
    <tr>
        <td colspan="2">
            <input type="submit" value="{$form.submit}" />
        </td>
    </tr>
</table>
</fieldset>
</form>